# -*-coding:utf-8-*-

import math

# NOTE: 构造纯素数列表
# STEP: 声明一个列表pi_list
pi_list = []
MAXSIZE = int(input())

# STEP: 从pi_list中删除非素数，仅保留素数
for i in range(1, MAXSIZE):
    for j in range(2, MAXSIZE):
        if (i > j and i % j == 0):
            break
    else:
        pi_list.append(i)

# # 输出pi_list
# print(pi_list)
count = 0
for i in range(0, len(pi_list) - 1):
    if (pi_list[i + 1] - pi_list[i] == 2):
        count += 1

print(count)
